﻿namespace Calculator

open System
open Wpf.Mvc

type Category = 
    { Name : string; Units : string list }  

    static member Values = 
        [
            { Name = "Angle"; Units = ["Degree"; "Gradian"; "Radian"] }
            { Name = "Area"; Units = ["Acres"; "Hectares"; "Square centimeters"; "Square feet"] }
            { Name = "Time"; Units = ["Day"; "Hour"; "Microsecond"; "Millisecond"; "Minute"; "Second"; "Week"] }
        ]

[<AbstractClass>]
type MainWindowModel() = 
    inherit Model()

    let mutable computation : int -> int = id

    member this.Computation with get() = computation and set value = computation <- value
    member this.RightValue = int this.Right

    abstract LeftAndOperator : string with get, set
    abstract Right : string with get, set
    abstract RunningTime : TimeSpan with get, set
    abstract Paused : Nullable<bool> with get, set

    abstract Category : seq<Category> with get, set
    abstract Units : seq<string> with get, set

    abstract Celsius : decimal with get, set
    abstract Fahrenheit : decimal with get, set
